package com.siderakis.gwt.cellwidgets.client.colorpicker;

import com.google.gwt.event.shared.GwtEvent;

public class HueChangedEvent extends GwtEvent<IHueChangedHandler> {
	private static GwtEvent.Type<IHueChangedHandler> TYPE;

	public static GwtEvent.Type<IHueChangedHandler> getType() {
		if (TYPE == null) {
			TYPE = new Type<IHueChangedHandler>();
		}
		return TYPE;
	}

	private final int hue;

	HueChangedEvent(final int hue) {
		this.hue = hue;
	}

	@Override
	protected void dispatch(final IHueChangedHandler handler) {
		handler.hueChanged(this);
	}

	@Override
	public GwtEvent.Type<IHueChangedHandler> getAssociatedType() {
		return TYPE;
	}

	public int getHue() {
		return hue;
	}
}
